package com.fdd.op.sdk.request.api.verify.person;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.response.api.verify.person.ChangeResponse;

import java.util.Map;

public class ChangeRequest extends BaseFddRequest<ChangeResponse> {
    @Override
    public String getApiMethodName() {
        return "/user/api/verify/person/change";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<ChangeResponse> getResponseClass() {
        return ChangeResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(getVerifiedWay() == null){
            throw new ApiRuleException("2", "参数验证失败，verifiedWay,认证方式不能传空");
        }
        if(StringUtils.isBlank(getNotifyUrl())){
            throw new ApiRuleException("2", "参数验证失败，notifyUrl,异步通知地址不能为空");
        }
        if(StringUtils.isBlank(getName())){
            throw new ApiRuleException("2", "参数验证失败，name,用户姓名不能为空");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_POST;
    }

    @RequestField
    private String accountId;

    @RequestField
    private String tpAccountId;

    @RequestField
    private Integer verifiedWay;

    @RequestField
    private String name;

    @RequestField
    private String personalBankCard;

    @RequestField
    private String notifyUrl;

    @RequestField
    private String returnUrl;

    @RequestField
    private Integer isSendSms;

    @RequestField
    private Integer resultType;

    @RequestField
    private Integer otherCertType;

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getTpAccountId() {
        return tpAccountId;
    }

    public void setTpAccountId(String tpAccountId) {
        this.tpAccountId = tpAccountId;
    }

    public Integer getVerifiedWay() {
        return verifiedWay;
    }

    public void setVerifiedWay(Integer verifiedWay) {
        this.verifiedWay = verifiedWay;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPersonalBankCard() {
        return personalBankCard;
    }

    public void setPersonalBankCard(String personalBankCard) {
        this.personalBankCard = personalBankCard;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getReturnUrl() {
        return returnUrl;
    }

    public void setReturnUrl(String returnUrl) {
        this.returnUrl = returnUrl;
    }

    public Integer getIsSendSms() {
        return isSendSms;
    }

    public void setIsSendSms(Integer isSendSms) {
        this.isSendSms = isSendSms;
    }

    public Integer getResultType() {
        return resultType;
    }

    public void setResultType(Integer resultType) {
        this.resultType = resultType;
    }

    public Integer getOtherCertType() {
        return otherCertType;
    }

    public void setOtherCertType(Integer otherCertType) {
        this.otherCertType = otherCertType;
    }
}
